{% extends "park/base.html" %}
{% block content %}
<script type="text/javascript">
    var primary_menu = "menu_0";
    var sub_menu = "menu_0_0";
</script>
<div class="col-md-12">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <div class="panel-title"><h3>添加填报批次</h3></div>
            <div class="panel-options">
                <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
            </div>
        </div>
            {% if message %}
                填报批次重复
            {% endif %}
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <form  method="post" action="/park/submitfill/"  class="form-horizontal form-groups-bordered">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">园区名称</label>
                            <input type="hidden" name="park_id" value="{{ park.id }}">
                            <div class="col-sm-5" style="padding-top:5px;">
                                {{ park.name }}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">填报开始时间</label>
                            <div class="col-sm-5">
                                <input class="Wdate form-control" type="text"  name="start_time" value="{{basic.operation_term}}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="*"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">填报结束时间</label>
                            <div class="col-sm-5">
                                <input class="Wdate form-control" type="text"  name="end_time" value="{{basic.operation_term}}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="*"/>
                            </div>
                        </div>
                        <div id="_fromBtn" class="form-group" style="margin: 10px 0px">
                            <div class="col-sm-offset-3 col-sm-5">
                                <input type="submit" class="btn btn-success btn-lg" value="保存">
                                <input class="btn btn-info btn-lg" type="reset" value="重置"/>
                            </div>
                        </div>
                </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block js %}
<script src="/static/js/city-choose.js"></script>
<script language="javascript">
    var dizhi = "{{basic.facilities_add0}}";
    $(function(){
        var flag = $("input[name='parent_company']:checked").val();
        if (flag==1) {
            $(".parentCompany").show();
            $(".parentCompany").eq(0).find("input").attr("datatype","*");
            $(".parentCompany").eq(1).find("input").attr("datatype","n");
        }else{
            $(".parentCompany").hide().find("input").removeAttr('datatype');
        }
        $(document).area("s_province","s_city","s_county");//调用插件
        $(document).area("m_province","m_city","m_county");//调用插件
        $("#s_province,#m_province").trigger("change")

        $("input[name='parent_company']").click(function(){
            var flag = $("input[name='parent_company']:checked").val();
            console.log(flag)
            if (flag==1) {
                $(".parentCompany").show();
                $(".parentCompany").eq(0).find("input").attr("datatype","*");
                $(".parentCompany").eq(1).find("input").attr("datatype","n");
            }else{
                $(".parentCompany").hide().find("input").removeAttr('datatype');
            }
        })
        
    });
    function getNextElement (field) {
        var form = field.form;
        for (var e = 0; e < form.elements.length; e++)
            if (field == form.elements[e])
                break;
        return form.elements[++e % form.elements.length];
    }
    


</script>
{% endblock %}
